<template>
  <base-dialog
    title="图片修剪"
    ref="baseDialog"
    top="5vh"
    width="60%"
    @handleClose="handleClose"
    @handleSubmit="handleSubmit"
  >
    <BaseCropper ref="BaseCropper" @uploadImgSuccess="uploadImgSuccess" />
  </base-dialog>
</template>

<script>
import BaseCropper from "@/components/BaseCropper"
export default {
  components: { BaseCropper },
  methods: {
    init() {
      this.$refs.baseDialog.dialogVisible = true
    },
    handleClose() {
      this.$refs.baseDialog.dialogVisible = false
    },
    // 封面提交
    handleSubmit() {
      this.$refs.BaseCropper.handleSubmit()
    },
    uploadImgSuccess(data) {
      this.handleClose()
      this.$emit("uploadImgSuccess", data)
    }
  }
}
</script>
